<template>
    <div>
        <el-dialog
                :title="train.title"
                :visible.sync="dialogVisible"
                width="50%"
        >
            <div>
                <div style="font-weight: 800;font-size: 18px">
                    <div style="font-size: 30px">培训名称：{{train.name}}</div>
                    <div  style="margin-top: 20px">培训对象：{{train.department.name}}</div>
                    <div style="margin-top: 20px">培训内容：{{train.content}}</div>
                    <div style="margin-top: 20px">培训时间：{{train.train_time}}</div>
                    <div style="margin-top: 20px">培训地点：{{train.train_location}}</div>
                    <div style="margin-top: 20px">培训要求：{{train.requirement}}</div>
                </div>
            </div>
            <span slot="footer" class="dialog-footer">
  </span>
        </el-dialog>

        <el-table
                :data="tableData"
                border
                style="width: 100%">
            <el-table-column
                    prop="name"
                    label="培训项目名称"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="train_location"
                    label="培训地点"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="train_time"
                    label="培训时间"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="department.name"
                    label="培训对象"
                    width="80">
            </el-table-column>
            <el-table-column
                    prop="status"
                    label="操作"
                    width="240">
                <template slot-scope="scope">
                    <el-button type="primary" @click="open(scope.row)">详情</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
    export default {
        name: "train_past",
        data(){
            return{
                allDeps:[],
                train:{
                    department:{}
                },
                dialogVisible:false,
                tableData:[],
            }
        },
        methods:{
            open(data){
                this.dialogVisible=true;
                this.train=data
                console.log(this.dialogVisible)
            },
            getTrain_1(){
                this.getRequest('/train/getTrain_0?status_id_1='+1).then(resp=>{
                    console.log(resp)
                    this.tableData=resp.data
                })
            },
            initDep(){
                this.getRequest('/employee/basic/deps').then(resp => {
                    if (resp) {
                        this.allDeps = resp;
                    }
                })
            },
        },
        mounted() {
            this.getTrain_1();
        }
    }
</script>

<style scoped>

</style>
